<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>监室管理系统 - 用户登录</title>
    <link rel="stylesheet" href="/static/styles.css">
</head>
<body>
    <div class="form-container">
        <h1 class="login-title">监室管理系统</h1>

        {% if error %}
        <div class="alert alert-danger">
            {{ error }}
        </div>
        {% endif %}

        <form method="post" action="/login">
            <div class="form-group">
                <label for="username">用户名</label>
                <input type="text" class="form-control" id="username" name="username" required>
            </div>

            <div class="form-group">
                <label for="password">密码</label>
                <div class="password-container">
                    <input type="password" class="form-control" id="password" name="password" required>
                    <button type="button" class="toggle-password" onclick="togglePasswordVisibility()">👁</button>
                </div>
            </div>

            <button type="submit" class="btn">登录</button>
        </form>

        <div class="register-link">
            <p>还没有账号？<a href="/register">立即注册</a></p>
        </div>
    </div>

    <script src="/static/scripts.js"></script>
</body>
</html>
